home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mikecom / rxflush.asm < prev    next >
Assembly Source File  |  1987-06-04  |  1KB  |  40 lines

  1.  
  2. title FLUSH RECEIVE BUFFER
  3. include subfx.h
  4.  
  5. ;  Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503
  6.  
  7. ifdef DBUG
  8. IMPORT_NEAR     <dsp_RXIN, dsp_RXOUT>
  9. endif
  10.  
  11. ;***************************************************************************
  12. ; ASYNC_RXFLUSH -- Clears the receive buffer.
  13. ;***************************************************************************
  14. begseg          COMM_TEXT
  15. publicproc      _async_rxflush
  16.         push    bp
  17.         mov     bp,sp
  18.         push    si              ;C stck frame, save regs
  19.         call    __ck_port_arg   ;ck for valid arg and load pointers
  20.         jz      rxfl_exit       ;arg was bad if ZR set on rtrn
  21.         cli
  22.         mov     ax,RX_SIZE
  23.         mov     RX_FREE,ax      ;reset free space variable
  24.         mov     ax,RX_TOP
  25.         mov     RX_IN,ax
  26.         mov     RX_OUT,ax       ;reset rx buffer pointers
  27. ifdef DBUG
  28.         call    dsp_RXIN
  29.         call    dsp_RXOUT
  30. endif
  31. rxfl_exit:
  32.         sti
  33.         pop     si
  34.         pop     bp
  35.         ret                     ;restore regs and exit
  36. _async_rxflush  endp
  37.  
  38. endseg          COMM_TEXT
  39.         end
  40.